package kr.saeildamil.androidstudy_second2930;

import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.widget.Toast;

public class MessengerService extends Service{
	
	@Override
	public IBinder onBind(Intent intent) {
		return mMessenger.getBinder();
	}
	Messenger mMessenger=new Messenger(new Handler(){
		public void handleMessage(Message msg) {
			super.handleMessage(msg);
			if(msg.what==0){
				Toast.makeText(MessengerService.this, "Hello~~~!", 0).show();
				
			}
		};
	});
}
